/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evangelion.core.bean;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Usuario
 */
@Entity
@Table(name = "permisosposee")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Permisoposee.findAll", query = "SELECT p FROM Permisoposee p"),
    @NamedQuery(name = "Permisoposee.findById", query = "SELECT p FROM Permisoposee p WHERE p.id = :id"),
    @NamedQuery(name = "Permisoposee.findByFechaingreso", query = "SELECT p FROM Permisoposee p WHERE p.fechaingreso = :fechaingreso"),
    @NamedQuery(name = "Permisoposee.findByPermiso", query = "SELECT p FROM Permisoposee p WHERE p.permiso = :permiso"),
    @NamedQuery(name = "Permisoposee.findByJefatura", query = "SELECT p FROM Permisoposee p WHERE p.jefatura = :jefatura"),
    @NamedQuery(name = "Permisoposee.findByExpedicion", query = "SELECT p FROM Permisoposee p WHERE p.expedicion = :expedicion")})
public class Permisoposee implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "fechaingreso")
    @Temporal(TemporalType.DATE)
    private Date fechaingreso;
    @Size(max = 30)
    @Column(name = "permiso")
    private String permiso;
    @Size(max = 30)
    @Column(name = "jefatura")
    private String jefatura;
    @Column(name = "expedicion")
    @Temporal(TemporalType.DATE)
    private Date expedicion;
    @JoinColumn(name = "id_alumno", referencedColumnName = "id")
    @ManyToOne
    private Alumno alumno;

    public Permisoposee() {
    }

    public Permisoposee(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getFechaingreso() {
        return fechaingreso;
    }

    public void setFechaingreso(Date fechaingreso) {
        this.fechaingreso = fechaingreso;
    }

    public String getPermiso() {
        return permiso;
    }

    public void setPermiso(String permiso) {
        this.permiso = permiso;
    }

    public String getJefatura() {
        return jefatura;
    }

    public void setJefatura(String jefatura) {
        this.jefatura = jefatura;
    }

    public Date getExpedicion() {
        return expedicion;
    }

    public void setExpedicion(Date expedicion) {
        this.expedicion = expedicion;
    }

    public Alumno getAlumno() {
        return alumno;
    }

    public void setAlumno(Alumno alumno) {
        this.alumno = alumno;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Permisoposee)) {
            return false;
        }
        Permisoposee other = (Permisoposee) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.evangelion.core.bean.Permisoposee[ id=" + id + " ]";
    }
    
}
